import java.util.ArrayList;
import java.util.LinkedList;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: syyyy
 * Date: 2025-10-30
 * Time: 21:41
 */
public class Test {
    public static ArrayList<ArrayList<Integer>> ret=new ArrayList<>();
    public static ArrayList<ArrayList<Integer>> func(int[] nums){
        LinkedList<Integer> list=new LinkedList<>();
        pathTrack(nums,list);
        return ret;
    }
    public static void pathTrack(int[] nums, LinkedList<Integer> list){
        if(list.size()== nums.length){
            ret.add(new ArrayList<>(list));
            return;
        }
        for (int i = 0; i < nums.length; i++) {
            if(list.contains(nums[i])){
                continue;
            }
            list.add(nums[i]);
            pathTrack(nums, list);
            list.removeLast();
        }
    }
    public static void main(String[] args) {

    }
}
